package com.example.demo.services.ServerImpl;

import com.example.demo.domain.Dynamic;
import com.example.demo.domain.DynamicRespository;
import com.example.demo.services.DynamicServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DynamicServerImpl implements DynamicServer {

    @Autowired
    DynamicRespository dynamicRespository;
    @Override
    public void save(Dynamic dynamic) {
        dynamicRespository.save(dynamic);

    }

    @Override
    public List<Map<String,String>> queryAllNews() {
        return dynamicRespository.queryAllNews();
    }

    @Override
    public List<Map<String, String>> getDynamicInfo(Long id) {
        return dynamicRespository.getDynamicInfo(id);
    }
}
